<div ng-include="'html/component/nav.html'" ng-controller="NavCtrl"></div>
<ul class="set_item" ng-include="'html/component/left_nav.html'" ng-controller="SettingNavCtrl"></ul>
<div class="set_box">
    <h1 class="set_title" ><!--定时任务-->{{language.TIPS_TIMED_TASK}}<i class="help" id="help_stockSynch" ng-click="help_prompt(language.HELP_PROMPT_STOCKSYNCH, 'help_stockSynch')"></i><span class="title_btn_group"  ng-model="master">
            <span class="title_btn" ng-click="save(taskContents);"><!--保存-->{{language.ACT_SAVE}}></span> </span></h1>
    <div class="set_cont stock_synch user_manage">
        <div class="table_wrap">
            <table class="user_table">
                <tr>
                    <th><!--单据类型-->{{language.TIPS_RECORD_TYPE}}</th>
                    <th><!--自动下载-->{{language.TIPS_AUTOMATIC_DOWNLOAGING}}</th>
                    <th><!--下载时间段-->{{language.TIPS_DOWNLOAD_TIME_BETWEEN}}</th>
                    <th><!--下载频率-->{{language.TIPS_DOWNLOAD_FREQUENCY}}</th>
                    <th><!--最后下载时间-->{{language.TIPS_LAST_DOWNLOAD_TIME}}</th>
                    <th><!--操作-->{{language.TIPS_OPERATION}}</th>
                </tr>   
                <tr ng-repeat="task in taskContents">
                    <td>{{task.task_name}}</td>
                    <td><input type="checkbox" ng-model="task.flag"></td>
                    <td><input type="time" ng-model="task.start_time"> - <input type="time" ng-model = "task.end_time"></td>
                    <td>
                        <select ng-model="task.frequency" ng-options="t.frequency as t.frequencySize for t in taskFrequency">
                            <option value=""><!--请选择-->{{language.TIPS_INVENTORY_SELECT}}</option>
                        </select>
                    </td>
                    <td>{{task.update_time && task.update_time*1000 | date:'yyyy-MM-dd HH:mm:ss'}}</td>
                    <td><button type="button" ng-click="download(task)" ><!--立即下载-->{{language.TIPS_DOWNLOAD_NOW}}</button></td>
                </tr>
            </table>
        </div>



        <ul class="synch_box synch_result">
            <li class="title">
                同步结果
                <!--{{language.TIPS_SET_SYNC_RESULT}}-->
            </li>
            <li class="result_table">
                <table>
                    <tr>
                        <th>
                            <label>同步结果<!--{{language.TIPS_SET_SHOW_SYNC_DEFEAT}}--></label></th>
                        <th>最近同步时间<!--{{language.TIPS_SET_SYNC_TIME_NEARLY}}--></th>
                        <th>单据类型<!--{{language.TIPS_SET_REASON}}--></th>
                    </tr>
                    <tr ng-repeat="res in results | orderBy:'time':'true' track by $index">
                        <td>
                            <button>
                                {{res.syn| task_syn }}
                            </button></td>
                        <td>{{res.time|date:'yyyy-MM-dd HH:mm:ss'}}</td>
                        <td >{{res.record_type}}</td>
                    </tr>
                </table>
            </li>
        </ul>
    </div>
</div>


